//
//  GJGCDTimer.h
//  yuanduo_app
//
//  Created by ZekiMini on 2021/8/3.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

@interface GJGCDTimer : NSObject
/// 初始化timer 返回timer唯一标识符
/// @param task 回调block
/// @param start 多少秒后开始
/// @param interval 定时器间隔时间
/// @param repeats 是否重复
/// @param async 是否在异步线程创建timer
+(NSString *)execTask:(void(^)(void))task
                start:(NSTimeInterval)start
             interval:(NSTimeInterval)interval
              repeats:(BOOL)repeats
                async:(BOOL)async;


/// 取消对应的timr
/// @param name timer唯一标识符
+ (void)cancelTask:(NSString *)name;


/// 暂停
/// @param name timer唯一标志符
+ (void)pauseTask:(NSString *)name;

/// 重新开始
/// @param name timer唯一标志符
+ (void)resumeTimer:(NSString *)name;

@end

NS_ASSUME_NONNULL_END
